﻿<?php
   $arrayid=$_POST['arrayid'];
   $id=$_GET['id'];
   
   //自己不能删除自己
    session_start();
	 
   //得到当前用户
    session_start();
	$username=$_SESSION['username'];

   
 
   $connect=mysql_connect("localhost","root","192510");
   mysql_select_db("news",$connect);
   
   
	if(isset($arrayid[0])){
		 foreach ($arrayid as $id){
           $sql="delete from user where id=$id and username!='".$username."'";
		   mysql_query($sql);
	    }
     }
   if(isset($id)){
	   
	   $sql="delete from user where id=$id and username!='".$username."'";
	   mysql_query($sql);
   }
   
	echo "<script>location='select_user.php'</script>";
	
	
	
	
	
?>